import { get, post, del, put } from "@/utils/request";
import {
  type addData,
  type addParams,
  type houseTypeListReturn,
  type houseTypeParams,
} from "./type";

// 房间类型
export const houseTypeList = (data: houseTypeParams) => {
  return get<houseTypeParams, houseTypeListReturn>("/api/housetype/list", data);
};

// 添加
export const houseTypeAdd = (data: addParams) => {
  return post<addParams, addData>("/api/housetype/add", data);
};

// 修改
export const houseTypeUpdate = (data: addParams) => {
  return put<addParams, null>("/api/housetype/update", data);
};

// 删除
export const houseTypeDel = (id: number) => {
  return del<number, null>(`/api/housetype/delete/${id}`);
};

// 批删
export const houseTypeDelAll = (data: number[]) => {
  return post<number[], null>("/api/housetype/deleteAll", data);
};
